package com.example.zhaojianxu.signin.signIn.teacher.viewModel

import android.arch.lifecycle.MutableLiveData
import android.arch.lifecycle.ViewModel
import com.example.zhaojianxu.signin.signIn.teacher.model.TeacherEntity
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch

class TeacherViewModel:ViewModel(){

    val teacher = MutableLiveData<List<TeacherEntity>>()

    fun refresh(){
        GlobalScope.launch {
            teacher.postValue(TeacherRequest().getTeacherList().await())
        }
    }

}